package org.hamster.multidropbox.dropbox.command
{
	import org.hamster.dropbox.DropboxEvent;
	import org.hamster.multidropbox.dropbox.vo.AppDropboxClient;
	import org.hamster.multidropbox.main.utils.PureMVCHelper;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	public class DropboxLinkFoldersCommand extends SimpleCommand
	{
		public function DropboxLinkFoldersCommand()
		{
			super();
		}
		
		override public function execute(notification:INotification):void
		{
			var body:Object = notification.getBody();
			var folderName:String = body.folderName;
			var accountUids:Array = body.accountUids;
			
			var clientList:Array = new Array();
			for each (var accountUid:int in accountUids) {
				clientList.push(PureMVCHelper.dropboxClientListProxy.getClientByUID(accountUid));
			}
			
			PureMVCHelper.dropboxLinkFoldersProxy.link(folderName, clientList);
		}
		
		private function metadataResultHandler(event:DropboxEvent):void
		{
		}
		
		private function metadataFaultHandler(event:DropboxEvent):void
		{
		}
	}
}